package com.kingland.wanxindong.controller;

import com.kingland.wanxindong.model.UserModel;
import com.kingland.wanxindong.service.UserService;
import org.springframework.web.bind.annotation.PostMapping;
import org.springframework.web.bind.annotation.RequestBody;
import org.springframework.web.bind.annotation.ResponseBody;
import org.springframework.web.bind.annotation.RestController;

@ResponseBody
@RestController
public class UserController {

    private  UserService userService;

    public UserController(UserService userService){
        this.userService = userService;
    }

    @PostMapping("/user")
    public UserModel addUser(@RequestBody UserModel userModel){
        this.userService.addUser(userModel);
        return userModel;
    }

}
